import { Map } from "immutable";
import * as actionTypes from "./constance";

const defaultState = Map({
  videoComment: [],
  videoDetail: [],
  videoUrl: [],
  videoDetailInfo: [],
  allVideo: [],
});

const videoR = (state = defaultState, action) => {
  switch (action.type) {
    case actionTypes.GET_VIDEO:
      return state.set("videoComment", action.videoComment);
    case actionTypes.GET_VIDEODETAIL:
      return state.set("videoDetail", action.videoDetail);
    case actionTypes.GET_VIDEOURL:
      return state.set("videoUrl", action.videoUrl);
    case actionTypes.GET_VIDEODETAILINFO:
      return state.set("videoDetailInfo", action.videoDetailInfo);
    case actionTypes.GET_MV_ALLVEDIO:
      return state.set("allVideo", action.allVideo);
    default:
      return state;
  }
};

export default videoR;
